import { UPDATE_CUR_SCHOOL, CLEAR_CUR_SCHOOL } from '../constants/index'

const CUR_SCHOOL = {
  schoolSId: ''
}

export default function setCurSchool (state = CUR_SCHOOL, action) {
  switch (action.type) {
    case UPDATE_CUR_SCHOOL:
      return {
        ...state,
        ...action.payload
      }
    case CLEAR_CUR_SCHOOL:
      return {
        schoolSId: ''
      }
    default:
       return state
  }
}
